﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Log
{
    /// <summary>
    /// Interaction logic for GetEmail.xaml
    /// </summary>
    public partial class GetEmail : Window
    {
        public GetEmail()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings["email"].Value = this.email.Text;
            config.AppSettings.Settings["password"].Value = this.pass.Password;
            config.Save(ConfigurationSaveMode.Full);
            ConfigurationManager.RefreshSection(config.AppSettings.SectionInformation.Name);
            this.DialogResult = true;
            this.Close();
        }
    }
}
